package com.qf.qflivehou.controller;
import com.qf.qflivehou.pojo.respVo.ResponseData;
import com.qf.qflivehou.pojo.vo.QfCourse;
import com.qf.qflivehou.service.QfCourseService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (QfCourse)表控制层
 *
 * @author makejava
 * @since 2022-01-10 21:56:08
 */

/**
 * 课程处理层
 */
@RestController
@RequestMapping("/qfCourse")
public class QfCourseController {
    /**
     * 服务对象
     */
    @Resource
    private QfCourseService qfCourseService;

    /**
     * 通过课程分类id查看所有课程
     * @param id
     * @return
     */
    @RequestMapping("/findCourseByClassify/{id}/{page}/{size}")
    public ResponseData findCourseByClassify(@PathVariable("id")Integer id,@PathVariable("page")Integer page,@PathVariable("size")Integer size){
        //System.out.println(id+"--"+page+"--"+size);
        ResponseData responseData = qfCourseService.findCourseByClassify(id,page,size);
        return responseData;
    }

    /**
     * 通过课程id查询课程信息
     * @param id
     * @return
     */
    @RequestMapping("/findCourseDetailById/{id}")
    public ResponseData findCourseDetailById(@PathVariable("id")Integer id){
        ResponseData responseData = qfCourseService.findCourseDetailById(id);
        return responseData;
    }


}